<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>


    <script>

        // 计算 `1*2*3*4*……*100` 的乘积
        var pro = 1;
        for (var i = 2; i <= 100; i++) {
            pro *= i;
        }
        pro = '<h1 style="color:skyblue;">' + pro + '</h1>';
        document.write(pro);

        // 页面中输出 1+2+3+4+……+100 算式，并计算结果。
        var sum = 0;
        var string = '';
        for (var i = 1; i <= 100; i++) {
            if (i < 100) {
                string = string + i + '+';
            } else {
                string = string + i + '=';
            }
            sum += i;
        }
        document.write(string, sum);


    </script>
</body>

</html>